<template>
    <el-radio-group v-model="model">
        <el-radio 
            v-for="(radio, index) in option.radios" 
            :key="index"
            :label="radio.label" 
            >
            {{radio.value}}
        </el-radio>
    </el-radio-group>
</template>
<script>
export default {
    name: 'iv-radio',
    props: {
        value: [String, Number, Boolean],
        option: {
            type: Object,
            default: () => {}
        }
    },
    computed: {
        model: {
            get() {
                return this.value
            },
            set(val) {
                this.$emit("update:value", val)
            }
        }
    },
    created(){
        this.model = this.value || this.option.radios[0].label
    }
}
</script>
